package com.wowangz.cms.systemmanage.imrecord.service;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import com.wowangz.cms.syscore.InitEnvironment;
import com.wowangz.cms.syscore.service.BaseService;
import com.wowangz.cms.syscore.utils.SpringUtil;
import com.wowangz.cms.systemmanage.imrecord.entity.ImRecord;


public class ImRecordService extends BaseService {

	private Logger logger = LoggerFactory.getLogger(ImRecordService.class);
	
	public List<ImRecord> findImRecords(String flow_id){
		
		List<ImRecord> list = null;
		DriverManagerDataSource dataSource = (DriverManagerDataSource)SpringUtil.getBean("openfireDataSource"); 
		SqlSession sqlsession = InitEnvironment.getSqlSessionFactory().openSession(dataSource,true);
		
		try{
			
			list = sqlsession.selectList("ImRecord.queryImrecrd",flow_id);
			
		}catch(Exception e){
			e.printStackTrace();
			throw e;
		}finally
		{
			if (sqlsession!=null) {
				sqlsession.close();
			}
		}
		return list;
	}
}
